﻿#region Copyright (c) 2013-06, Olaf Kober <amarok.projects@gmail.com>
//================================================================================
//	Permission is hereby granted, free of charge, to any person obtaining a copy
//	of this software and associated documentation files (the "Software"), to deal
//	in the Software without restriction, including without limitation the rights
//	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//	copies of the Software, and to permit persons to whom the Software is
//	furnished to do so, subject to the following conditions:
//
//	The above copyright notice and this permission notice shall be included in
//	all copies or substantial portions of the Software.
//
//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//	THE SOFTWARE.
//================================================================================
#endregion

using System.Windows;
using Amarok.Agents;


namespace Amarok.Presentation
{
	/// <summary>
	/// This static type defines attached dependency properties.
	/// </summary>
	public static class View
	{
		#region ++ Attached Dependency Property: Environment ++

		/// <summary>
		/// This field identifies the attached dependency property Environment.
		/// </summary>
		public static readonly DependencyProperty EnvironmentProperty = DependencyProperty.RegisterAttached(
			"Environment",
			typeof(AgentEnvironment),
			typeof(View),
			new FrameworkPropertyMetadata(
				null,
				FrameworkPropertyMetadataOptions.Inherits
			)
		);


		/// <summary>
		/// Gets the value of the attached property Environment for the given element.
		/// </summary>
		[AttachedPropertyBrowsableForType(typeof(FrameworkElement))]
		public static AgentEnvironment GetEnvironment(FrameworkElement element)
		{
			// IMPORTANT:	To maintain parity between XAML and procedural code, 
			//				do not touch this method!
			return (AgentEnvironment)element.GetValue(EnvironmentProperty);
		}

		/// <summary>
		/// Sets the value of the attached property Environment for the given element.
		/// </summary>
		public static void SetEnvironment(FrameworkElement element, AgentEnvironment value)
		{
			// IMPORTANT:	To maintain parity between XAML and procedural code, 
			//				do not touch this method!
			element.SetValue(EnvironmentProperty, value);
		}

		#endregion

		#region ++ Attached Dependency Property: Options ++

		/// <summary>
		/// This field identifies the attached dependency property Options.
		/// </summary>
		public static readonly DependencyProperty OptionsProperty = DependencyProperty.RegisterAttached(
			"Options",
			typeof(AgentOptions),
			typeof(View),
			new FrameworkPropertyMetadata(
				AgentOptions.Empty,
				FrameworkPropertyMetadataOptions.Inherits
			)
		);


		/// <summary>
		/// Gets the value of the attached property Options for the given element.
		/// </summary>
		[AttachedPropertyBrowsableForType(typeof(FrameworkElement))]
		public static AgentOptions GetOptions(FrameworkElement element)
		{
			// IMPORTANT:	To maintain parity between XAML and procedural code, 
			//				do not touch this method!
			return (AgentOptions)element.GetValue(OptionsProperty);
		}

		/// <summary>
		/// Sets the value of the attached property Options for the given element.
		/// </summary>
		public static void SetOptions(FrameworkElement element, AgentOptions value)
		{
			// IMPORTANT:	To maintain parity between XAML and procedural code, 
			//				do not touch this method!
			element.SetValue(OptionsProperty, value);
		}

		#endregion

	}
}
